package com.lyn.common.util;

import java.util.ArrayList;
import java.util.List;
import java.util.TreeMap;

import com.jfinal.kit.StrKit;

public class SqlUtil {
	private String sqlSelect;
	private String sqlFrom;
	private String sqlAnd;
	private TreeMap<String, Object> params = new TreeMap<String, Object>();
	
	private static final String WHERE = " where ";
	
	private String sql;

	public String getSqlSelect() {
		return sqlSelect;
	}

	public void setSqlSelect(String sqlSelect) {
		this.sqlSelect = sqlSelect;
	}

	public String getSqlFrom() {
		return sqlFrom;
	}

	public void setSqlFrom(String sqlFrom) {
		this.sqlFrom = sqlFrom;
	}

	public String getSqlAnd() {
		return sqlAnd;
	}

	public void setSqlAnd(String sqlAnd) {
		this.sqlAnd = sqlAnd;
	}
	
	public String getSql() {
		sql = sqlSelect+sqlFrom;
		if(StrKit.notBlank(sqlAnd)) {
			sql += WHERE + sqlAnd; 
		}
		return sql;
	}
	
	
	
}
